cmake_minimum_required(VERSION 3.4.1)  #编译最低cmake版本


#源码路径
file (GLOB sourceCode "${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/*cpp"
                      "${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/GLUtil/*cpp"
                      "${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/Shape/*cpp"
            )

#将集合里的所有的源文件生成一个静态库，该静态库的名字是native-lib
add_library( native-lib SHARED ${sourceCode})

#配置头文件
target_include_directories( native-lib PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
                            native-lib PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
                            native-lib PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/>
                            native-lib PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/GLUtil/cpp/>
                            native-lib PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/Shape/cpp/>
                            native-lib PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/glm/gtx>
                            native-lib PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/glm/gtc>
                            native-lib PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/glm/detail>
)

# 链接静态库需要的依赖库
target_link_libraries( native-lib
                       GLESv2
                       android
                       log
                     )